const express = require('express');
const qualifications = express.Router() //创建路由

const index=require("./index/index.js")

const { getMachine } = require("../../tool/tool")

qualifications.use((req,res,next)=>{
    if (getMachine(req) == "pc") {
        req.loc=true  
    }else{
        req.loc=false
    }
    next()
})

// 重定向到主页
qualifications.get("/",(req,res)=>{
    res.redirect("/v/index.html")
})

// 直接访问主页
qualifications.get("/index.html",index)

// 百科大全 
qualifications.get("/baike",require("./baike"))

// 资质论坛
qualifications.get("/bbs",require("./bbs"))

// 出售资质
qualifications.get("/chushou",require("./chushou"))

// 找回密码
qualifications.get("/forgetPass",require("./forgetPass"))


module.exports = qualifications